home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-10-12 | 3.9 KB | 118 lines | [TEXT/PJMM] |
- unit Aliases;
-
- { Pascal Interface to the Macintosh Libraries }
-
- { Copyright © Apple Computer Inc. }
- { All Rights Reserved }
-
- { Adapted for use with THINK Pascal 4.0.x by Marco Piovanelli }
-
- interface
-
- const
-
- rAliasType = 'alis'; { aliases are stored as resources of this type }
-
- { define alias resolution action rules mask }
-
- kARMMountVol = $00000001; { mount the volume automatically }
- kARMNoUI = $00000002; { no user interface allowed during resolution }
- kARMMultVols = $00000008; { search on multiple volumes }
- kARMSearch = $00000100; { search quickly }
- kARMSearchMore = $00000200; { search further }
- kARMSearchRelFirst = $00000400; { search target on a relative path first }
-
- { define alias record information types }
-
- asiZoneName = -3; { get zone name }
- asiServerName = -2; { get server name }
- asiVolumeName = -1; { get volume name }
- asiAliasName = 0; { get aliased file/folder/volume name }
- asiParentName = 1; { get parent folder name }
-
-
- type
-
- { define the alias record that will be the blackbox for the caller }
-
- AliasPtr = ^AliasRecord;
- AliasHandle = ^AliasPtr;
- AliasRecord = record
- userType: OSType; { appl stored type like creator type }
- aliasSize: Integer; { alias record size in bytes, for appl usage }
- end;
-
- AliasInfoType = Integer; { alias record information type }
- AliasFilterProcPtr = ProcPtr;
-
- { create a new alias between fromFile-target and return alias record handle }
- function NewAlias (fromFile: FSSpecPtr;
- target: FSSpec;
- var alias: AliasHandle): OSErr;
- inline
- $7002, $A823;
-
- { create a minimal new alias for a target and return alias record handle }
- function NewAliasMinimal (target: FSSpec;
- var alias: AliasHandle): OSErr;
- inline
- $7008, $A823;
-
- { create a minimal new alias from a target fullpath (optional zone and server name) and return alias record handle }
- function NewAliasMinimalFromFullPath (fullPathLength: INTEGER;
- fullPath: Ptr;
- zoneName: Str32;
- serverName: Str31;
- var alias: AliasHandle): OSErr;
- inline
- $7009, $A823;
-
- { given an alias handle and fromFile, resolve the alias, update the alias record and return aliased filename and wasChanged flag. }
- function ResolveAlias (fromFile: FSSpecPtr;
- alias: AliasHandle;
- var target: FSSpec;
- var wasChanged: BOOLEAN): OSErr;
- inline
- $7003, $A823;
-
- { given an alias handle and an index specifying requested alias information type, return the information from alias record as a string. }
- function GetAliasInfo (alias: AliasHandle;
- index: AliasInfoType;
- var theString: Str63): OSErr;
- inline
- $7007, $A823;
-
- { given a file spec, return target file spec if input file spec is an alias.}
- { It resolves the entire alias chain or one step of the chain. It returns}
- { info about whether the target is a folder or file; and whether the input}
- { file spec was an alias or not.}
- function ResolveAliasFile (var theSpec: FSSpec;
- resolveAliasChains: BOOLEAN;
- var targetIsFolder: BOOLEAN;
- var wasAliased: BOOLEAN): OSErr;
- inline
- $700C, $A823;
-
- { Low Level Routines }
- {given an alias handle and fromFile, match the alias and return aliased filename(s) and needsUpdate flag}
- function MatchAlias (fromFile: FSSpecPtr;
- rulesMask: LONGINT;
- alias: AliasHandle;
- var aliasCount: INTEGER;
- aliasList: FSSpecArrayPtr;
- var needsUpdate: BOOLEAN;
- aliasFilter: AliasFilterProcPtr;
- yourDataPtr: univ Ptr): OSErr;
- inline
- $7005, $A823;
-
- { given a fromFile-target pair and an alias handle, update the lias record pointed to by alias handle to represent target as the new alias. }
- function UpdateAlias (fromFile: FSSpecPtr;
- target: FSSpec;
- alias: AliasHandle;
- var wasChanged: BOOLEAN): OSErr;
- inline
- $7006, $A823;
-
- implementation
- end.